package gxb.test10;

import java.util.Arrays;

public class Queue {
    public static void main(String[] args) {
        Test test = new Test();
        test. sort(5, 2);

        // 对三个数进行排序
        test.sort(8, 1, 6);

        // 对数组进行排序
        int[] numbers = { 4, 9, 3, 7 };
        test.sort(numbers);
    }
}
class Test{
    public void sort(int a,int b){
        if (a>b)
            System.out.println("两个数的排序结果："+a +" "+b);
        else
            System.out.println("两个数的排序结果："+b +" "+a);
    }
    public void sort(int a,int b,int c){
        int[] nums = { a, b, c };
        Arrays.sort(nums);
        System.out.print("三个数的排序结果：");
        for (int num : nums) {
            System.out.print(num+" ");
        }
        System.out.println();
    }
    public void sort(int[] list){
        Arrays.sort(list);
        System.out.print("数组的排序结果：");
        System.out.println(Arrays.toString(list));
    }
}
